/**
* \file NetworkPlugin.cpp
* \brief NetworkPlugin decleration class for windows plugin
* \author Edouard ROGE
* \date 12 Novembre 2013
*/

#include "Core/Profile/Profiler.h"
#include "Core/Profile/CodeProfile.h"
#include "Core/Thread/ThreadManager.h"
#include "Core/Log/LogManager.h"
#include "NetworkContext.h"
#include "NetworkPlugin.h"

NetworkPlugin::NetworkPlugin()
{
}

NetworkPlugin::~NetworkPlugin()
{
	Core::Thread::ThreadManager::GetInstance().Clear();
	Core::Memory::MemoryPoolManager::GetInstance().CheckLeaks(false);

	Core::Thread::ThreadManager::DeleteInstance();
	Core::Log::LogManager::DeleteInstance();
	Core::Profile::Profiler::DeleteInstance();
	Core::Memory::MemoryPoolManager::DeleteInstance();
}

const std::string & NetworkPlugin::GetName() const
{
	static std::string strName = "Network Windows Plugin";
	return strName;
}

Core::Network::INetworkContext * NetworkPlugin::CreateContext() const
{
	return new NetworkContext();
}

void NetworkPlugin::DestroyContext(Core::Network::INetworkContext * _pContext) const
{
	if (_pContext)
	{
		delete (NetworkContext*)_pContext;
	}
}
